package com.zork.cmdb.webapi.common.response;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author chenjh
 * @date 2018/5/14
 * @description
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ResponseEntityEnum {
    SUCCESS("000000","成功")
    ,PARAM_EROOR("000001", "参数错误")
    ,MODULE_NOT_FOUND_ERROR("000002", "模型不存在")
    ,RESOURCE_NOT_FOUND_ERROR("000404", "访问资源不存在")
    ,UNKONW_ERROR("000999","未知错误")
    ,REJECT("000003","ip或时间段被限制访问")
    ;
    private String code;
    private Object data;
    private String message;

    ResponseEntityEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public Object getData() {
        return data;
    }

    public ResponseEntityEnum setData(Object data) {
        this.data = data;
        return this;
    }

    public String getMessage() {
        return message;
    }

    public ResponseEntityEnum setMsg (String msg) {
        this.message = msg;
        return this;
    }
}